import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'

Vue.use(Router)

// // 03移动
// import admin from './admin/yidong'

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    },


    // 阿里云的路由
    {
      path: '/login',
      name: 'login',
      component: () => import('./views/阿里云/login'),
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('./views/阿里云/home'),
      children: [
        {
          path: '/home1',
          name: 'home1',
          component: () => import('./views/阿里云/home1'),
          meta: {
            bread: ['后台首页']
          }
        },
        {
          path: '/goods',
          name: 'goods',
          component: () => import('./views/阿里云/goods'),
          meta: {
            bread: ['云服务es', '实力列表']
          }
        },
        {
          path: '/nums',
          name: 'nums',
          component: () => import('./views/阿里云/nums'),
          meta: {
            bread: ['数据统计']
          }
        },
        {
          path: '/index',
          name: 'index',
          component: () => import('./views/阿里云/index'),
          meta: {
            bread: ['系统设置']
          }
        },
        {
          path: '/deail',
          name: 'deail',
          component: () => import('./views/阿里云/deail'),
          meta: {
            bread: ['详情页面']
          }
        },
        {
          path: '/cart',
          name: 'cart',
          component: () => import('./views/阿里云/cart'),
        },
      ]
    },


    // 移动端路由
    {
      path: '/yd/deail',
      name: 'yd_deail',
      component: () => import('./views/移动端/deail'),
    },
    {
      path: '/yd/login',
      name: 'yd_login',
      component: () => import('./views/移动端/login'),
    },
    {
      path: '/yd/home',
      name: 'yd_home',
      component: () => import('./views/移动端/home'),
      redirect:'/yd/sy',
      children: [
        {
          path: '/yd/sy',
          name: 'yd_sy',
          component: () => import('./views/移动端/sy'),
        },
        {
          path: '/yd/index',
          name: 'yd_index',
          component: () => import('./views/移动端/index'),
        },
        {
          path: '/yd/cart',
          name: 'yd_cart',
          component: () => import('./views/移动端/cart'),
        },
        {
          path: '/yd/me',
          name: 'yd_me',
          component: () => import('./views/移动端/me'),
        },

      ]
    }
  ]
})
